package com.nanrui.mutualinductor.data;


import com.network.utils.LogUtils;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;

public class Packet_57_01
        extends DKPacket {
    private short mFlag;
    private short mGrade;
    private float mMeaWinMiniLoad;
    private float mMeaWinRatedLoad;
    private float mPhaseAngle;
    private float mRatedPrimary;
    private float mRatedSecondary;
    private float mSurWinMiniLoad;
    private float mSurWinRatedLoad;
    private int sBackup;
    private float sDCR;
    private float[] sDErrors;
    private float[] sFErrors;
    private short sFlag;
    private short sGrade;
    private float sMeaWinMiniLoad;
    private float sMeaWinRatedLoad;
    private float sPhaseAngle;
    private float[] sPhaseDisps;
    private float sPhaseError;
    private float[] sPhaseRoundDisps;
    private float sQuadratureError;
    private float sRatedPrimary;
    private float sRatedSecondary;
    private short sResult;
    private float sSecondaryR;
    private short sStatus;
    private float sSurWinMiniLoad;
    private float sSurWinRatedLoad;
    private float[] sUErrors;
    private float[] sURoundErrors;
    private float sWorkingVoltage;
    private float sXb;

    public Packet_57_01() {
        super((short) 3, (short) 87);
    }

    public short getmFlag() {
        return this.mFlag;
    }

    public short getmGrade() {
        return this.mGrade;
    }

    public float getmMeaWinMiniLoad() {
        return this.mMeaWinMiniLoad;
    }

    public float getmMeaWinRatedLoad() {
        return this.mMeaWinRatedLoad;
    }

    public float getmPhaseAngle() {
        return this.mPhaseAngle;
    }

    public float getmRatedPrimary() {
        return this.mRatedPrimary;
    }

    public float getmRatedSecondary() {
        return this.mRatedSecondary;
    }

    public float getmSurWinMiniLoad() {
        return this.mSurWinMiniLoad;
    }

    public float getmSurWinRatedLoad() {
        return this.mSurWinRatedLoad;
    }

    public float getsDCR() {
        return this.sDCR;
    }

    public float[] getsDErrors() {
        return this.sDErrors;
    }

    public float[] getsFErrors() {
        return this.sFErrors;
    }

    public short getsFlag() {
        return this.sFlag;
    }

    public short getsGrade() {
        return this.sGrade;
    }

    public float getsMeaWinMiniLoad() {
        return this.sMeaWinMiniLoad;
    }

    public float getsMeaWinRatedLoad() {
        return this.sMeaWinRatedLoad;
    }

    public float getsPhaseAngle() {
        return this.sPhaseAngle;
    }

    public float[] getsPhaseDisps() {
        return this.sPhaseDisps;
    }

    public float getsPhaseError() {
        return this.sPhaseError;
    }

    public float[] getsPhaseRoundDisps() {
        return this.sPhaseRoundDisps;
    }

    public float getsQuadratureError() {
        return this.sQuadratureError;
    }

    public float getsRatedPrimary() {
        return this.sRatedPrimary;
    }

    public float getsRatedSecondary() {
        return this.sRatedSecondary;
    }

    public short getsResult() {
        return this.sResult;
    }

    public float getsSecondaryR() {
        return this.sSecondaryR;
    }

    public short getsStatus() {
        return this.sStatus;
    }

    public float getsSurWinMiniLoad() {
        return this.sSurWinMiniLoad;
    }

    public float getsSurWinRatedLoad() {
        return this.sSurWinRatedLoad;
    }

    public float[] getsUErrors() {
        return this.sUErrors;
    }

    public float[] getsURoundErrors() {
        return this.sURoundErrors;
    }

    public float getsWorkingVoltage() {
        return this.sWorkingVoltage;
    }

    public float getsXb() {
        return this.sXb;
    }

    @Override
    byte[] packContent() {
        byte[] arrayOfByte = new byte[30];
        int i = 0 + 1;
        arrayOfByte[0] = ((byte) (byte) this.mFlag);
        int j = i + 1;
        arrayOfByte[i] = ((byte) (byte) this.mGrade);
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mRatedPrimary).array(), 0, arrayOfByte, j, 4);
        j += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mRatedSecondary).array(), 0, arrayOfByte, j, 4);
        j += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mMeaWinRatedLoad).array(), 0, arrayOfByte, j, 4);
        j += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mMeaWinMiniLoad).array(), 0, arrayOfByte, j, 4);
        j += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mSurWinRatedLoad).array(), 0, arrayOfByte, j, 4);
        j += 4;
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mSurWinMiniLoad).array(), 0, arrayOfByte, j, 4);
        System.arraycopy(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putFloat(this.mPhaseAngle).array(), 0, arrayOfByte, j + 4, 4);
        return arrayOfByte;
    }

    public Packet_57_01 setmFlag(short paramShort) {
        this.mFlag = ((short) paramShort);
        return this;
    }

    public Packet_57_01 setmGrade(short paramShort) {
        this.mGrade = ((short) paramShort);
        return this;
    }

    public Packet_57_01 setmMeaWinMiniLoad(float paramFloat) {
        this.mMeaWinMiniLoad = paramFloat;
        return this;
    }

    public Packet_57_01 setmMeaWinRatedLoad(float paramFloat) {
        this.mMeaWinRatedLoad = paramFloat;
        return this;
    }

    public Packet_57_01 setmPhaseAngle(float paramFloat) {
        this.mPhaseAngle = paramFloat;
        return this;
    }

    public Packet_57_01 setmRatedPrimary(float paramFloat) {
        this.mRatedPrimary = paramFloat;
        return this;
    }

    public Packet_57_01 setmRatedSecondary(float paramFloat) {
        this.mRatedSecondary = paramFloat;
        return this;
    }

    public Packet_57_01 setmSurWinMiniLoad(float paramFloat) {
        this.mSurWinMiniLoad = paramFloat;
        return this;
    }

    public Packet_57_01 setmSurWinRatedLoad(float paramFloat) {
        this.mSurWinRatedLoad = paramFloat;
        return this;
    }

    @Override
    void unpackContent(byte[] paramArrayOfByte) {
        int i = 0 + 1;
        this.sFlag = ((short) (short) (paramArrayOfByte[0] & 0xFF));
        int j = i + 1;
        this.sGrade = ((short) (short) (paramArrayOfByte[i] & 0xFF));
        i = j + 1;
        this.sResult = ((short) (short) (paramArrayOfByte[j] & 0xFF));
        j = i + 1;
        this.sStatus = ((short) (short) (paramArrayOfByte[i] & 0xFF));
        i = j + 1;
        int k = paramArrayOfByte[j];
        j = i + 1;
        this.sBackup = (k & 0xFF | paramArrayOfByte[i] << 8 & 0xFFFF);
        i = j + 4;
        this.sRatedPrimary = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sRatedSecondary = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = j + 4;
        this.sMeaWinRatedLoad = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sMeaWinMiniLoad = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        k = j + 4;
        this.sSurWinRatedLoad = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, k)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = k + 4;
        this.sSurWinMiniLoad = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, k, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sPhaseAngle = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = j + 4;
        this.sPhaseError = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = i + 4;
        this.sQuadratureError = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = j + 4;
        this.sWorkingVoltage = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        k = i + 4;
        this.sSecondaryR = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, k)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        j = k + 4;
        this.sDCR = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, k, j)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        i = j + 4;
        this.sXb = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, j, i)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
        this.sFErrors = new float[3];
        k = 0;
        j = 0;
        float[] arrayOfFloat = null;
        int m;
        while (j < this.sFErrors.length) {
            arrayOfFloat = this.sFErrors;
            m = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            j++;
            i = m;
        }

        for (int l = 0; l < arrayOfFloat.length; l++) {
            LogUtils.d("packet_57", "sFErrors" + arrayOfFloat[l] + "");
        }

        this.sDErrors = new float[3];
        j = 0;
        while (j < this.sDErrors.length) {
            arrayOfFloat = this.sDErrors;
            m = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            j++;
            i = m;
        }

        for (int ll = 0; ll < arrayOfFloat.length; ll++) {
            LogUtils.d("packet_57", "sDErrors" + arrayOfFloat[ll] + "");
        }
        this.sUErrors = new float[5];
        j = 0;
        while (j < this.sUErrors.length) {
            arrayOfFloat = this.sUErrors;
            m = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            j++;
            i = m;
        }
        this.sURoundErrors = new float[5];
        j = 0;
        while (j < this.sURoundErrors.length) {
            arrayOfFloat = this.sURoundErrors;
            m = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            j++;
            i = m;
        }
        this.sPhaseDisps = new float[5];
        j = 0;
        while (j < this.sPhaseDisps.length) {
            arrayOfFloat = this.sPhaseDisps;
            m = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, m)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            j++;
            i = m;
        }
        this.sPhaseRoundDisps = new float[5];
        for (j = k; j < this.sPhaseRoundDisps.length; j++) {
            arrayOfFloat = this.sPhaseRoundDisps;
            k = i + 4;
            arrayOfFloat[j] = ByteBuffer.wrap(Arrays.copyOfRange(paramArrayOfByte, i, k)).order(ByteOrder.LITTLE_ENDIAN).getFloat();
            i = k;
        }
    }
}
